﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace Generator.Tools
{
    public partial class CloseForm : ToolsBase
    {

        [DllImport("user32.dll", CharSet = CharSet.Auto)]
        public static extern int SendMessage(int hWnd, int msg, int wParam, int lparam);

        public CloseForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                int hd = Convert.ToInt32(textBox1.Text, 16);
                SendMessage(hd, 0x0010, 0, 0);
            }
            catch (Exception ex)
            {
                richTextBox1.Text = ex.ToString();
            }

        }
    }
}
